package com.brush.system.domain.req.sysconfig;

import cn.hutool.core.util.StrUtil;
import com.brush.common.core.domain.page.PageAbstructReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Date;

/**
 * ClassName: SysConfigQueryReq
 * Package: com.exam.web.controller.config.req
 * Description:
 *
 *          参数配置查询请求对象
 *
 * @Author luo
 * @Create 2024/8/23 10:38
 * @Version 1.0
 */
@Getter
@Setter
@ToString(callSuper = true)
@ApiModel(value = "SysConfigQueryReq", description = "参数配置查询请求对象")
public class SysConfigQueryReq extends PageAbstructReq {

    /**
     * 参数名称
     */
    @ApiModelProperty(value = "参数名称")
    private String configName;

    /**
     * 参数键值
     */
    @ApiModelProperty(value = "参数键值")
    private String configKey;

    /**
     * 系统内置（Y是 N否）
     */
    @ApiModelProperty(value = "系统内置（Y是 N否）")
    private String configType;


    @ApiModelProperty(value = "开始时间")
    private Date beginTime;

    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    @ApiModelProperty(hidden = true)
    @Override
    public String getOrderBy() {
        if (StrUtil.isNotBlank(super.getOrderByColumn())){
            return super.getOrderByColumn() + " " + super.getIsAsc();
        }
        return null;
    }
}
